package com.adjy.pathbuilders.scenario;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;

/**
 * The classes that implement this interface must provide methods
 * for loading the game scenarios data from persistent resources.
 */
public interface ScenarioLoader {
	/**
	 * Loads the data of a {@link Scenario} from the given {@link InputStream}.
	 *  
	 * @param scenarioSource The stream from which to read the {@link Scenario} data.
	 * @return A new {@link Scenario} object.
	 * @throws IOException If there is an error while reading the stream.
	 */
	Scenario load(InputStream scenarioSource) throws IOException;
	
	/**
	 * Loads the data of a {@link Scenario} from the given {@link List}.
	 * 
	 * @param source the source {@link List}.
	 * @return A new {@link Scenario} object.
	 * @throws IllegalArgumentException if the data contained in the list is not valid.
	 */
	Scenario load(List<String> source);
}
